package config

import (
	"bufio"
	"encoding/json"
	"fmt"
	"github.com/fatih/color"
	"gopkg.in/yaml.v2"
	"os"
	"path/filepath"
)

type htmldata struct {
	URLDATA map[string][]any
	DomName map[string][]any
	Dir     map[string][]any
	JsData  map[string]bool
}

var HtmlData htmldata

func rpath() string {
	project_path, _ := os.Getwd()
	return project_path
}

func Read_config() (map_data map[any]any) {
	/*读取配置文件*/
	data, err := os.ReadFile("./config/config.yaml")
	if err != nil {
		panic("读取配置文件错误")
	}
	if err1 := yaml.Unmarshal(data, &map_data); err != nil {
		panic(err1)
	}
	return
}

func Read_fuzz() (b []string) {
	//读取fuzz

	file, err := os.Open(filepath.Join(rpath(), "fuzz/js.txt"))
	if err != nil {
		panic("读取fuzz错误")
	}
	defer file.Close()
	scanner := bufio.NewScanner(file)
	for scanner.Scan() {
		//逐行读取
		line := scanner.Text() // or
		//line := scanner.Bytes()
		if len(line) == 0 {
			continue
		}
		b = append(b, line)
		//do_your_function(line)
	}
	return
}

func Create_html(name string, host string, htmltype int) {
	//创建模板
	Pwd, _ := os.Getwd()
	file, err := os.OpenFile(filepath.Join(rpath(), "tem/"+name+".html"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
	if err != nil {
		panic("生成模板错误，请检查是否存在tem目录")
	}
	defer file.Close()

	file_data := bufio.NewWriter(file)
	//内容小于规定的大小时执行,写入操作
	js, err1 := os.OpenFile(filepath.Join(rpath(), "tem/"+name+".js"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
	if err1 != nil {
		panic("生成js文件错误")
	}
	defer js.Close()
	js_data := bufio.NewWriter(js)
	js_data.WriteString(fmt.Sprintf("var host='%s';", host))

	//js_data.WriteString("var table = document.querySelector(\".table_box>tbody\");\nwindow.onload = function(){\n    \n    \n    for(let [key,value] of Object.entries(url[0])){\n        var trBox = document.createElement(\"tr\");\n        if (key.substring(0,5)==='https'||key.substring(0,4)==='http'){\n            let html= `\n        \n        <td>\n        <a href='${key}' target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        \n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        \n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        \n        }else{\n            let html= `\n        <tr>\n        <td>\n        <a href='${host+key}' target=\"_blank\" style=\"text-decoration:none;\">${host+key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n\n        }\n    }\n   \n\n\n    var menu_box = document.querySelector(\".menu_box\");\n    var name=[\"本站信息\",\"其他域名\",\"本站js\"]\n    for(let i = 0; i < name.length; i++){\n        var itemBox = document.createElement(\"div\");\n        itemBox.className = \"menu_item\";\n        itemBox.innerHTML = `${name[i]}`;\n        itemBox.onclick = function(){\n            if (i==1){\n                domname();\n            }else if(i==0){\n                urls();\n            }else{\n                js();\n            }\n        }\n        menu_box.appendChild(itemBox);\n    }\n}\n\nconst middleBox = document.querySelector(\".box_middle\");\nconst leftBox = document.querySelectorAll(\".box_left\")[1];\nmiddleBox.onmousedown = function(e){\n    // console.log(e);\n    let startX = e.clientX;\n    let startWidth = leftBox.clientWidth;\n    leftBox.left = leftBox.offsetLeft;\n    document.onmousemove = function(move){\n        let endX = move.clientX;\n        let moveLen = move.clientX - startX;\n        console.log(moveLen);\n        leftBox.style.width = startWidth + moveLen + 'px';\n    }\n    document.onmouseup = function(evt){\n        evt.stopPropagation();\n        document.onmousedown = null;\n        document.onmousemove = null;\n    }\n}\n\n\nfunction domname(){\n    console.log(123)\n    table.innerHTML=\"\";\n    for(let [key,value] of Object.entries(domnameurl[0])){\n        var trBox = document.createElement(\"tr\");\n        let html= `\n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n    }\n}\nfunction js(){\n    table.innerHTML=\"\";\n    for(let [key,value] of Object.entries(jsname[0])){\n        var trBox = document.createElement(\"tr\");\n        let html= `\n        <tr>\n        <td>${key}</td>\n         <td>${value}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n    }\n}\nfunction urls(){\n    table.innerHTML=\"\";\n    for(let [key,value] of Object.entries(url[0])){\n        var trBox = document.createElement(\"tr\");\n        if (key.substring(0,5)==='https'||key.substring(0,4)==='http'){\n            let html= `\n        <tr>\n        <td>\n        <a href='${key}' target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        }else{\n            let html= `\n        <tr>\n        <td>\n        <a href='${host+key}' target=\"_blank\" style=\"text-decoration:none;\">${host+key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        }\n    }\n}")
	if htmltype == 1 {
		file_data.WriteString("<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <link rel=\"shortcut icon\" href=\"../css/src/img/123.jpg\" type=\"image/x-icon\">\n    <title>Lightning</title>\n    <link rel=\"stylesheet\" href=\"../css/index.css\">\n</head>\n\n<body>\n    <div class=\"info_box\">\n        <div class=\"info_top\">\n            <div class=\"box_left\">\n                <img class=\"logo_img\" src=\"../css/src/img/123.jpg\" alt=\"\" srcset=\"\">\n            </div>\n            <div class=\"box_right titlt_right\">\n                <span class=\"title_text\">\n                    LIGHTNING\n                </span>\n            </div>\n        </div>\n        <div class=\"info_bottom\">\n            <div class=\"box_left menu_box\"></div>\n            <div class=\"box_middle\"></div>\n            <div class=\"box_right table_list_box\">\n                <table class=\"table_box\">\n                    <thead>\n                       \n                    </thead>\n                    <tbody>\n                    </tbody>\n\n                </table>\n            </div>\n        </div>\n    </div>\n</body>\n<script src=\"" + name + ".js\"></script>\n</html>")
		file_data.Flush()
		json_url, _ := json.Marshal(HtmlData.URLDATA)
		json_domname, _ := json.Marshal(HtmlData.DomName)
		json_js, _ := json.Marshal(HtmlData.JsData)
		js_data.WriteString(fmt.Sprintf("var url=[JSON.parse('%s')];\nvar domnameurl=[JSON.parse('%s')];\nvar jsname=[JSON.parse('%s')];", json_url, json_domname, json_js))

		//js_data.WriteString("var table = document.querySelector(\".table_box>tbody\");\nvar ths =document.querySelector(\".table_box>thead\");\nwindow.onload = function(){\n    \n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>敏感字段</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n        \n    for(let [key,value] of Object.entries(url[0])){\n        var trBox = document.createElement(\"tr\");\n        if (key.substring(0,5)==='https'||key.substring(0,4)==='http'){\n            let html= `\n        \n        <td>\n        <a href='${key}' target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        \n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        \n        `\n        \n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        \n        }else{\n            let html= `\n        <tr>\n        <td>\n        <a href='${host+key}' target=\"_blank\" style=\"text-decoration:none;\">${host+key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n\n        }\n    }\n   \n    var menu_box = document.querySelector(\".menu_box\");\n    var name=[\"本站信息\",\"其他域名\",\"本站js\"]\n    for(let i = 0; i < name.length; i++){\n        var itemBox = document.createElement(\"div\");\n        itemBox.className = \"menu_item\";\n        itemBox.innerHTML = `${name[i]}`;\n        itemBox.onclick = function(){\n            console.log(i)\n            if (i==1){\n                domname();\n            }else if(i==0){\n                urls();\n            }else if(i==2){\n                js();\n            }\n        }\n        menu_box.appendChild(itemBox);\n    }\n}\n\n\nconst middleBox = document.querySelector(\".box_middle\");\nconst leftBox = document.querySelectorAll(\".box_left\")[1];\nmiddleBox.onmousedown = function(e){\n    // console.log(e);\n    let startX = e.clientX;\n    let startWidth = leftBox.clientWidth;\n    leftBox.left = leftBox.offsetLeft;\n    document.onmousemove = function(move){\n        let endX = move.clientX;\n        let moveLen = move.clientX - startX;\n        console.log(moveLen);\n        leftBox.style.width = startWidth + moveLen + 'px';\n    }\n    document.onmouseup = function(evt){\n        evt.stopPropagation();\n        document.onmousedown = null;\n        document.onmousemove = null;\n    }\n}\n\n\nfunction domname(){\n    ths.innerHTML=\"\";\n    table.innerHTML=\"\";\n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>敏感字段</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n\n    for(let [key,value] of Object.entries(domnameurl[0])){\n        var trBox = document.createElement(\"tr\");\n        let html= `\n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n    }\n}\nfunction js(){\n    ths.innerHTML=\"\";\n    table.innerHTML=\"\";\n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>敏感字段</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n    for(let [key,value] of Object.entries(jsname[0])){\n        var trBox = document.createElement(\"tr\");\n        let html= `\n        <tr>\n        <td>${key}</td>\n         <td>${value}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n    }\n}\nfunction urls(){\n    \n    table.innerHTML=\"\";\n    for(let [key,value] of Object.entries(url[0])){\n        var trBox = document.createElement(\"tr\");\n        if (key.substring(0,5)==='https'||key.substring(0,4)==='http'){\n            let html= `\n        <tr>\n        <td>\n        <a href='${key}' target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        }else{\n            let html= `\n        <tr>\n        <td>\n        <a href='${host+key}' target=\"_blank\" style=\"text-decoration:none;\">${host+key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        }\n    }\n}")
		js_data.WriteString("var table = document.querySelector(\".table_box>tbody\");\nvar ths =document.querySelector(\".table_box>thead\");\nwindow.onload = function(){\n    \n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>敏感字段</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n        \n    for(let [key,value] of Object.entries(url[0])){\n        var trBox = document.createElement(\"tr\");\n        if (key.substring(0,5)==='https'||key.substring(0,4)==='http'){\n            let html= `\n        \n        <td>\n        <a href='${key}' target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        \n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        \n        `\n        \n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        \n        }else{\n\t\t\tvar aaa=\"\"\n\t\t\tif(key.substr(0, 1) == \"/\"){\n\t\t\t\taaa=host+key\n\t\t\t}else{\n\t\t\t\taaa=host+\"/\"+key\n\t\t\t}\n\t\t\t\n            let html= `\n        <tr>\n        <td>\n        <a href=${aaa} target=\"_blank\" style=\"text-decoration:none;\">${aaa}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n\n        }\n    }\n   \n    var menu_box = document.querySelector(\".menu_box\");\n    var name=[\"本站信息\",\"其他域名\",\"本站js\"]\n    for(let i = 0; i < name.length; i++){\n        var itemBox = document.createElement(\"div\");\n        itemBox.className = \"menu_item\";\n        itemBox.innerHTML = `${name[i]}`;\n        itemBox.onclick = function(){\n            console.log(i)\n            if (i==1){\n                domname();\n            }else if(i==0){\n                urls();\n            }else if(i==2){\n                js();\n            }\n        }\n        menu_box.appendChild(itemBox);\n    }\n}\n\n\nconst middleBox = document.querySelector(\".box_middle\");\nconst leftBox = document.querySelectorAll(\".box_left\")[1];\nmiddleBox.onmousedown = function(e){\n    // console.log(e);\n    let startX = e.clientX;\n    let startWidth = leftBox.clientWidth;\n    leftBox.left = leftBox.offsetLeft;\n    document.onmousemove = function(move){\n        let endX = move.clientX;\n        let moveLen = move.clientX - startX;\n        console.log(moveLen);\n        leftBox.style.width = startWidth + moveLen + 'px';\n    }\n    document.onmouseup = function(evt){\n        evt.stopPropagation();\n        document.onmousedown = null;\n        document.onmousemove = null;\n    }\n}\n\n\nfunction domname(){\n    ths.innerHTML=\"\";\n    table.innerHTML=\"\";\n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>敏感字段</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n\n    for(let [key,value] of Object.entries(domnameurl[0])){\n        var trBox = document.createElement(\"tr\");\n        let html= `\n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n    }\n}\nfunction js(){\n    ths.innerHTML=\"\";\n    table.innerHTML=\"\";\n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>敏感字段</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n    for(let [key,value] of Object.entries(jsname[0])){\n        var trBox = document.createElement(\"tr\");\n        let html= `\n        <tr>\n        <td>${key}</td>\n         <td>${value}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n    }\n}\nfunction urls(){\n    \n    table.innerHTML=\"\";\n    for(let [key,value] of Object.entries(url[0])){\n        var trBox = document.createElement(\"tr\");\n        if (key.substring(0,5)==='https'||key.substring(0,4)==='http'){\n            let html= `\n        <tr>\n        <td>\n        <a href='${key}' target=\"_blank\" style=\"text-decoration:none;\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        }else{\n            let html= `\n        <tr>\n        <td>\n        <a href='${host+key}' target=\"_blank\" style=\"text-decoration:none;\">${host+key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        }\n    }\n}")
	} else if htmltype == 2 {
		if len(HtmlData.Dir) == 0 {
			color.Red("\n未发现url，不生成文档")
			return
		}
		file_data.WriteString("<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n    <meta charset=\"UTF-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <link rel=\"shortcut icon\" href=\"../css/src/img/123.jpg\" type=\"image/x-icon\">\n    <title>Lightning</title>\n    <link rel=\"stylesheet\" href=\"../css/index.css\">\n</head>\n\n<body>\n    <div class=\"info_box\">\n        <div class=\"info_top\">\n            <div class=\"box_left\">\n                <img class=\"logo_img\" src=\"../css/src/img/123.jpg\" alt=\"\" srcset=\"\">\n            </div>\n            <div class=\"box_right titlt_right\">\n                <span class=\"title_text\">\n                    LIGHTNING\n                </span>\n            </div>\n        </div>\n        <div class=\"info_bottom\">\n            \n            <div class=\"box_right table_list_box\">\n                <table class=\"table_box\">\n                    <thead>\n                       \n                    </thead>\n                    <tbody>\n                    </tbody>\n\n                </table>\n            </div>\n        </div>\n    </div>\n</body>\n<script src=\"" + name + ".js\"></script>\n</html>")
		file_data.Flush()
		json_dir, _ := json.Marshal(HtmlData.Dir)
		js_data.WriteString(fmt.Sprintf("var dir=[JSON.parse('%s')];\n", json_dir))
		//js_data.WriteString("var table = document.querySelector(\".table_box>tbody\");\nvar ths =document.querySelector(\".table_box>thead\");\nwindow.onload = function(){\n    ths.innerHTML=\"\";\n    table.innerHTML=\"\";\n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>Location</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n    \n    for(let [key,value] of Object.entries(dir[0])){\n        var trBox = document.createElement(\"tr\");\n        var cl=\"\"\n        if (value[0]==302){\n                cl=\"color:red\"\n        }else if (value[0]==403){\n            cl=\"color:red\"\n        }\n        if (value.length>=3){\n            let html= `\n        \n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;${cl}\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        \n        }else{\n            let html= `\n        \n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;${cl}\" >${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td></td>\n        </tr>\n        `\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n        }\n    }\n    \n    }")
		//js_data.WriteString("var table = document.querySelector(\".table_box>tbody\");\nvar ths =document.querySelector(\".table_box>thead\");\nwindow.onload = function(){\n    ths.innerHTML=\"\";\n    table.innerHTML=\"\";\n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>Location</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n    \n    for(let [key,value] of Object.entries(dir[0])){\n        var trBox = document.createElement(\"tr\");\n        var cl=\"\"\n        var a=value[0].toString().substring(0,1);\n        let html;\n        if (a==\"3\"){\n            cl=`color:forestgreen`\n        }else if (a==\"4\"){\n            \n            cl=`color:red`\n        }\n        if (value.length>=3){\n            console.log(value[0],value[1])\n            html= `\n            \n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;${cl};\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td>${value[2]}</td>\n        </tr>\n        `\n        \n        }else{\n            console.log(2)\n            html= `\n        \n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;${cl};\" >${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td></td>\n        </tr>\n        `\n        \n        }\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n    }\n    \n    }")
		js_data.WriteString("var table = document.querySelector(\".table_box>tbody\");\nvar ths =document.querySelector(\".table_box>thead\");\nwindow.onload = function(){\n    ths.innerHTML=\"\";\n    table.innerHTML=\"\";\n    var tr_th=document.createElement(\"tr\");\n    let th=`\n        <th>url</th>\n        <th>状态码</th>\n        <th>Location</th>\n    `\n    tr_th.innerHTML=th\n    ths.appendChild(tr_th)\n    \n    for(let [key,value] of Object.entries(dir[0])){\n        var trBox = document.createElement(\"tr\");\n        var cl=\"\"\n        var a=value[0].toString().substring(0,1);\n        let html;\n        if (a==\"3\"){\n            cl=`color:forestgreen`\n        }else if (a==\"4\"){\n            \n            cl=`color:red`\n        }\n        if (value.length>=3){\n            console.log(value[0],value[1])\n            html= `\n            \n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;${cl};\">${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td><a href=\"${value[2]}\">${value[2]}</></td>\n        </tr>\n        `\n        \n        }else{\n            console.log(2)\n            html= `\n        \n        <tr>\n        <td><a href=\"${key}\" target=\"_blank\" style=\"text-decoration:none;${cl};\" >${key}</a></td>\n        <td>status_code:${value[0]};size:${value[1]}</td>\n        <td></td>\n        </tr>\n        `\n        \n        }\n        trBox.innerHTML = html;\n        table.appendChild(trBox);\n    }\n    \n    }")
	}
	js_data.Flush()

	color.Green("\n文档已生成在" + filepath.Join(Pwd, "tem", name+".html") + "文件下")

}

func CreateDir() {

}
